  <?php
  session_start();

@$isok=$_SESSION["islogin"];


if(!$isok){
    header("Refresh:3;url=diancanxitong.php");
    exit("请先登录！");
}

@$id = $_REQUEST["id"];
	$pdo=new PDO("mysql:dbname=caipin;host=127.0.0.1;charset=UTF8","root","root");
    $sql3=$pdo->prepare("select * from zhuohao;");
    $sql3->execute();
    $arrl=$sql3->fetchAll(PDO::FETCH_NAMED);

?>


<html>
<head>
   <meta charset="UTF-8">
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="css/bootstrap.css">
    <link type="text/css" rel="stylesheet" href="css/bootstrap-theme.css">
    <script src="js/jQuery文件.js"></script>
    <script src="js/bootstrap.js"></script>
</head>
<body>
<!--导航条-->
<nav class="navbar navbar-default">
    <div class="container-fluid" >
        <div class="navbar-header" >

                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="zhuohao.php" style="margin: 0 0 0 80px;font-size: 30px ">点餐系统</a>
                    </div>


                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">订餐管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="dindanliebiao.php">订单列表</a></li>
                                    <li><a href="dindanjilu.php">订单记录</a></li>       
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">菜品管理<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="caitianjia.php">添加菜品</a></li>
                                    <li><a href="caileibiao.php">菜品列表</a></li>                             
                                    <li role="separator" class="divider"></li>
                                    <li><a href="cailiexing.php">添加菜品类型</a></li>                                
                                    <li><a href="cailiexingliebiao.php">菜品类型列表</a></li>
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">餐桌管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="tianjia.php">添加餐桌</a></li>
                                    <li><a href="liebiao.php">餐桌列表</a></li>                                  
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">登录管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">关于点餐系统</a></li>
                                    <li><a href="#"></a></li>
                                    <li><a href="#"></a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="xiugai.php">修改登录信息</a></li>                                
                                    <li><a href="tuichu.php" >退出登录</a></li>												  
                                </ul>
                            </li>
                        </ul>

                    </div>
                </div>

            </nav>
			 <!--修改表-->
	<div class="row">
	<div class="col-sm-offset-1 col-sm-2">
	<a href="tianjia.php" type="submit" class="btn btn-default btn-block">添加餐桌
	</a>
	<a href="zhuohao.php" type="submit" class="btn btn-default btn-block">返回首页
	</a>
    </div>


<div class="col-sm-8">
<div class="panel panel-primary">
            <div class="panel-heading">
                <h1 class="panel-title">
                    <span class="glyphicon glyphicon-th-list"></span>
                                                            餐桌列表
                </h1>
            </div>
            <table class="table table-striped table-bordered table-hover">
                <tr>
                    <th>名称</th>
                    <th>&nbsp;</th>
                </tr>
				
                              <?php
			for($g=0;$g<count($arrl);$g++){
                 $y=$arrl[$g];
				?>
	               
                 <tr>              
                                
                 <td><?php echo $y["zhuoname"];?></td>

                    <td>
                        <a href="xiugaicanzhuo.php?id=<?php echo $y["zhuoid"]?>">编辑</a>
                        <a href="#<?php echo $y["zhuoid"]?>" data-toggle="modal">删除</a>
                        <div class="modal fade" id="<?php echo $y["zhuoid"]?>" tabindex="-1" >
                        	<div class="modal-dialog">
                        		<div class="modal-content">
                        			<div class="modal-header">
                        				<button type="button" class="close" data-dismiss="modal">
                        					<span>&times;</span><span class="sr-only">Close</span>
                        				</button>
                        				<h4 class="modal-title">确定删除[<?php echo $y["zhuoname"];?>]</h4>
                        			</div>
                        			<div class="modal-body">
                        			     你确定要删除餐桌[<?php echo $y["zhuoname"];?>]吗？
                        			</div>
                        			<div class="modal-footer">
                        				<a type="button" class="btn btn-default" href="shanchucanzhuo.php?id=<?php echo $y["zhuoid"]?>">确定</a>
                        				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        			</div>
                        		</div>
                        	</div>
                        </div>
                    </td>
                </tr>
   <?php
			 }                  
                	?>
                            </table>
        </div>
	</div>
</div>

		<footer>
		  <hr/>
		  <p class="text-right"><small>点餐系统Demo@喻德软件快训</small></p>
		</footer>
	</div>





































</div>
</div>
</body>
<html>
